package hxy.dragon.qrcode

import androidx.compose.ui.graphics.ImageBitmap
import androidx.compose.ui.graphics.toComposeImageBitmap
import org.jetbrains.skia.Image

actual fun bytesToImageBitmap(bytes: ByteArray): ImageBitmap? {
    return try {
        val image = Image.makeFromEncoded(bytes)
        image?.toComposeImageBitmap()
    } catch (e: Exception) {
        e.printStackTrace()
        null
    }
}
